package com.sky.mapper;
import java.math.BigDecimal;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    /**
     * 查询
     * @param shoppingCart
     * @return List<ShoppingCart>
     * @description description
     */
    List<ShoppingCart> listByAll(ShoppingCart shoppingCart);

    /**
     * 更新数量
     * @param shoppingCart
     * @return int
     * @description description
     */
    int updateNumberById(@Param("shoppingCart") ShoppingCart shoppingCart);

    /**
     * 查询当前用户购物车
     * @param userId
     * @return List<ShoppingCart>
     * @description description
     */
    List<ShoppingCart> listAllByUserId(@Param("userId")Long userId);

    /**
     * 清空用户购物车
     * @param userId
     * @return int
     * @description description
     */
    int deleteByUserId(@Param("userId")Long userId);

    /**
     * 添加购物车
     * @param shoppingCart
     * @return int
     * @description description
     */
    int insertSelective(ShoppingCart shoppingCart);










}
